{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import sys\n",
    "from matplotlib import pyplot as plt\n",
    "import os"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Function to read results/stats from the output reports"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def getStat(dataDirectory, stats = [\"simSeconds\"], statNames = ['sSec'],columnNames = [\"test\", \"device\", \"condition\"]):\n",
    "    fileNames = os.listdir(dataDirectory)\n",
    "    filePaths = [os.path.join(dataDirectory, '', i, 'stats.txt').replace('\\\\','/') for i in fileNames]\n",
    "    dfStats = pd.DataFrame([i.split(\"_\") for i in fileNames],columns= columnNames)\n",
    "    dfStats[statNames] = None\n",
    "    dfStats[\"file\"] = fileNames\n",
    "    for fileIdx in range(len(dfStats)):\n",
    "        for statIdx in range(len(stats)):\n",
    "            with open(filePaths[fileIdx]) as f:\n",
    "                readlines = f.readlines()\n",
    "                for l in readlines:\n",
    "                    if stats[statIdx] in l:\n",
    "                        dfStats[statNames[statIdx]][fileIdx] = float(l.split()[1])\n",
    "    dfStats = dfStats.sort_values(by=columnNames)\n",
    "    return dfStats"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Function to plot desired stats"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plotStats(df, xFactor, yValue, fillFactor,scaleFac = 1):\n",
    "    xLevels = np.unique(df[xFactor])\n",
    "    fillLevels = np.unique(df[fillFactor])\n",
    "\n",
    "    df = df.sort_values(by=[xFactor])\n",
    "\n",
    "    barWidth = 1/(len(xLevels)+1)\n",
    "    colors = getCmap(len(fillLevels)+1)\n",
    "\n",
    "    for sIdx in range(len(yValue)):\n",
    "        s = yValue[sIdx]\n",
    "        plt.figure()\n",
    "        inds = np.arange(len(xLevels))\n",
    "        for fillIdx in range(len(fillLevels)):\n",
    "            f = fillLevels[fillIdx]\n",
    "            plt.bar(inds, df[s][df[fillFactor]==f]*scaleFac,width = barWidth, color = colors(fillIdx), edgecolor ='grey', label =f)\n",
    "            inds = [x + barWidth for x in inds]\n",
    "        plt.xticks([r + barWidth for r in range(len(xLevels))], xLevels)\n",
    "        plt.legend()\n",
    "        plt.xlabel(xFactor, fontweight ='bold', fontsize = 15)\n",
    "        plt.ylabel(s, fontweight ='bold', fontsize = 15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def getCmap(n, name='hsv'):\n",
    "    '''Returns a function that maps each index in 0, 1, ..., n-1 to a distinct \n",
    "    RGB color; the keyword argument name must be a standard mpl colormap name.'''\n",
    "    return plt.cm.get_cmap(name, n)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Read stats sample using defined functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    test device rdPrct          rBW (GB/s)          wBW (GB/s)            file\n",
      "8  m5out   ddr3    R50   4757298246.850823   4829487124.681857  m5out_ddr3_R50\n",
      "5  m5out   ddr3     RO  10813346263.297775                 0.0   m5out_ddr3_RO\n",
      "2  m5out   ddr3     WO                 0.0  11080562149.297314   m5out_ddr3_WO\n",
      "3  m5out   ddr4    R50   7584099206.333008   7731104167.152448  m5out_ddr4_R50\n",
      "4  m5out   ddr4     RO  17943311840.151024                 0.0   m5out_ddr4_RO\n",
      "1  m5out   ddr4     WO                 0.0  17653445743.629044   m5out_ddr4_WO\n",
      "7  m5out    nvm    R50   1170086689.623155   1194404833.467871   m5out_nvm_R50\n",
      "6  m5out    nvm     RO   6013847785.399859                 0.0    m5out_nvm_RO\n",
      "0  m5out    nvm     WO                 0.0   1956526453.870762    m5out_nvm_WO\n"
     ]
    },
    {
     "data": {
      "image/png": "i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oXxnASek6+eTVLccBTxD8oN8ZbrvDnZWJj0zPcc+wKlp2y0RsaOTWI4HPpVuPgd8gKSa6Xjg3m7GYVYyJwPrS44k+cEFuCYi/hgRLwHz2/X7SN76DcAW4AWS5AHwfkkDI+LvJAkB0mQAfIzkRxvgpgKx5J/jkoh4NCL+HhGLI+KmDvp0GkeBc5gVzcnA+pJ35a2vyltvP1NcQxfHEbB/up774R6V3sfP3SJaHhHLChwj/xydlSDvThxmJXEysL7k5bz1YXnrB7brtzZd7gAGR4TyP8AeEZFLJvey8zbTeez833yhqwKANXnrh3fSpztxmJXEycD6kmXApnT905LeI+kgYGa7fr9Jl3sA35c0LB3Vc6Sk/wN8O9cxIrYBP043P0/yEHgHcHMXsfwqb/2bkholDZQ0TtK53Y3DrFROBtZnRMQGdv6AjiB5ELuSXa8SIPkhz81r/AmSUUFbSSa2+QowqF3/3Kii3Hs7D3Y113FEPEwyyTokI4UeI3kYvQQ4eTfjMNttTgbW18wD/g1YR3KVcAvwmfwOEfEmyYiguSQJow3YSDIx+nzgqnb9HyUZEZTT1S2inH9Jz/0YsJnkAfFTpMNRuxuHWSk805mZmfnKwMzMnAzMzAwnAzMzw8nAzMxwMjAzM5wMzMwMJwMzM8PJwMzMgP8Pc8Uyt1KV7ioAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dataDirectory = '/workspaces/gem5-bootcamp-env/traffGenRes'\n",
    "columnNames = [\"test\", \"device\", \"rdPrct\"]\n",
    "stats = ['system.generator.readBW',\n",
    "         'system.generator.writeBW']\n",
    "statNames = ['rBW (GB/s)',\"wBW (GB/s)\"]\n",
    "df = getStat(dataDirectory, stats ,statNames ,columnNames)\n",
    "print(df)\n",
    "df[\"totBW (GB/s)\"] = df[\"rBW (GB/s)\"]+df[\"wBW (GB/s)\"]\n",
    "\n",
    "# plotStats(df, xFactor = \"device\", yValue = [\"rBW (GB/s)\",\"wBW (GB/s)\",\"totBW (GB/s)\"], fillFactor = \"rdPrct\")\n",
    "plotStats(df, xFactor = \"device\", yValue = [\"totBW (GB/s)\"], fillFactor = \"rdPrct\",scaleFac = 1/(1024*1024*1024))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.10 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
